package com.wen.controller;

import com.wen.common.R;
import com.wen.pojo.dto.GatherDetailsDto;
import com.wen.pojo.dto.PayDetailsDto;
import com.wen.service.PayDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/payDetails")
public class PayDetailsController {

    @Autowired
    private PayDetailsService service;
    @GetMapping("DetailsById/{id}")
    public R gatherById(@PathVariable String id){
        List<PayDetailsDto> payDetailsDto = service.payDetailsById(id);
        return R.ok().data("payDetailsDto",payDetailsDto);
    }
    @GetMapping("payById/{id}")
    public R payById(@PathVariable String id){
        List<PayDetailsDto> payDetailsDtos = service.payById(id);
        return R.ok().data("payDetailsDtos",payDetailsDtos);
    }

}
